package com.fau.om.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;
import org.json.simple.JSONAware;
import org.json.simple.JSONObject;

/**
 * @desc 各身份订单统计实体类
 * @author kangyj
 * @datetime 2014年12月11日,下午7:46:14
 */
@Entity
@Table(name = "medical_orders_province_sta")
public class MedicalOrdersProvinceSta implements Serializable, JSONAware {

	private static final long serialVersionUID = -4765018105353739365L;

	private String id;
	private String ordersId;			// 订单id
	private String provinceId;			// 省份id
	private String provinceName;		// 省名称
	private BigDecimal commodityMoney;	// 订单货款
	private String deliveryType;		// 投递状态
	private String hospitalId;			// 医院id
	private Date ordersTime;			// 订单时间
	private String startTime;		// 下单开始时间
	private String endTime;			// 下单结束时间
	private Integer ordersCount;		// 订单数
	private BigDecimal tcommodityMoney;	// 总金额
	private Integer postCount;			// 妥投单数
	private BigDecimal postMoney;		// 妥投金额
	private Integer backCount;			// 退回单数
	private BigDecimal backMoney;		// 退回金额
	private Integer feedbackCount;		// 无反馈单数
	private BigDecimal feedbackMoney;	// 无反馈金额
	
	private Date stime;
	private Date etime;

	@Id
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@GeneratedValue(generator = "generator")
	@Column(name = "id", length = 32)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "orders_id", length = 32)
	public String getOrdersId() {
		return ordersId;
	}

	public void setOrdersId(String ordersId) {
		this.ordersId = ordersId;
	}

	@Column(name = "province_id", length = 32)
	public String getProvinceId() {
		return provinceId;
	}

	public void setProvinceId(String provinceId) {
		this.provinceId = provinceId;
	}

	@Column(name = "province_name", length = 32)
	public String getProvinceName() {
		return provinceName;
	}

	public void setProvinceName(String provinceName) {
		this.provinceName = provinceName;
	}

	@Column(name = "commodity_money", length = 11)
	public BigDecimal getCommodityMoney() {
		return commodityMoney;
	}

	public void setCommodityMoney(BigDecimal commodityMoney) {
		this.commodityMoney = commodityMoney;
	}

	@Column(name = "delivery_type", length = 5)
	public String getDeliveryType() {
		return deliveryType;
	}

	public void setDeliveryType(String deliveryType) {
		this.deliveryType = deliveryType;
	}

	@Column(name = "hospital_id", length = 32)
	public String getHospitalId() {
		return hospitalId;
	}

	public void setHospitalId(String hospitalId) {
		this.hospitalId = hospitalId;
	}
	
	@Column(name = "orders_time")
	public Date getOrdersTime() {
		return ordersTime;
	}

	public void setOrdersTime(Date ordersTime) {
		this.ordersTime = ordersTime;
	}

	@Transient
	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	@Transient
	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	@Transient
	public Integer getOrdersCount() {
		return ordersCount;
	}

	public void setOrdersCount(Integer ordersCount) {
		this.ordersCount = ordersCount;
	}

	@Transient
	public BigDecimal getTcommodityMoney() {
		return tcommodityMoney;
	}

	public void setTcommodityMoney(BigDecimal tcommodityMoney) {
		this.tcommodityMoney = tcommodityMoney;
	}

	@Transient
	public Integer getPostCount() {
		return postCount;
	}

	public void setPostCount(Integer postCount) {
		this.postCount = postCount;
	}

	@Transient
	public BigDecimal getPostMoney() {
		return postMoney;
	}

	public void setPostMoney(BigDecimal postMoney) {
		this.postMoney = postMoney;
	}

	@Transient
	public Integer getBackCount() {
		return backCount;
	}

	public void setBackCount(Integer backCount) {
		this.backCount = backCount;
	}

	@Transient
	public BigDecimal getBackMoney() {
		return backMoney;
	}

	public void setBackMoney(BigDecimal backMoney) {
		this.backMoney = backMoney;
	}
	
	@Transient
	public Integer getFeedbackCount() {
		return feedbackCount;
	}

	public void setFeedbackCount(Integer feedbackCount) {
		this.feedbackCount = feedbackCount;
	}

	@Transient
	public BigDecimal getFeedbackMoney() {
		return feedbackMoney;
	}

	public void setFeedbackMoney(BigDecimal feedbackMoney) {
		this.feedbackMoney = feedbackMoney;
	}

	@Transient
	public Date getStime() {
		return stime;
	}

	public void setStime(Date stime) {
		this.stime = stime;
	}

	@Transient
	public Date getEtime() {
		return etime;
	}

	public void setEtime(Date etime) {
		this.etime = etime;
	}

	@SuppressWarnings("unchecked")
	@Override
	public String toJSONString() {
		JSONObject obj = new JSONObject();
		obj.put("provinceName", provinceName);
		obj.put("ordersCount", ordersCount);
		obj.put("tcommodityMoney", tcommodityMoney);
		obj.put("postCount", postCount);
		obj.put("postMoney", postMoney);
		obj.put("backCount", backCount);
		obj.put("backMoney", backMoney);
		obj.put("feedbackCount", feedbackCount);
		obj.put("feedbackMoney", feedbackMoney);
		
		return obj.toString();
	}

}
